import request from '@/router/axios';
export const list = (data) => request({
    url: '/category/list',
    method: 'post',
    data
});
export const create = (data) => request({
    url: '/category/create',
    method: "post",
    data
});
export const update = (data) => request({
    url: '/category/update',
    method: "post",
    data
});
export const remove = (id) => request({
    url: '/category/delete',
    method: "post",
    data: {
        id: Array.isArray(id) ? id : [id]
    }
});

export function loadTreeData() {
    return request({
        url: '/category/load-tree-data',
        method: "post"
    })
}

export function offline(id) {
    return request({
        url: '/category/offline',
        method: "post",
        data: {
            id: Array.isArray(id) ? id : [id]
        }
    });
}

export function online(id) {
    return request({
        url: '/category/online',
        method: "post",
        data: {
            id: Array.isArray(id) ? id : [id]
        }
    });
}
